<?php
// 应用公共文件
namespace app;

class common{
    /**
     * [getHttpImg 获取图片的http地址]
     * @param  [type] $img [description]
     * @return [type]      [description]
     */
    public static function getHttpImg($img)
    {
        $list = explode('/', $img);
        $len  = count($list);
        if($len > 1){
            $name = $list[$len-1];

            $http = "http://myimg.com/game_npc/";
            $http_img = $http.$name;
            return $http_img;
        }else{
            return $img;
        }
    }
}
